$(function () {
   //获取要查看的订单编号
   var orderId = getQueryString('orderId');
   initOrder(orderId);

   function initOrder(orderId) {
       var url = '/order/showOrder?orderId='+ orderId;
       $.getJSON(url,function (data) {
           if (data.code == 200) {
               $('#customerName').val(data.data.customer.customerName);
               $('#phone').val(data.data.customer.phone);
               $('#type').val(data.data.car.type);
               $('#carColor').val(data.data.car.color);
               $('#carNum').val(data.data.carNum);
               $('#price').val(data.data.car.price);
               $('#salePrice').val(data.data.car.salePrice);
               $('#totalMoney').val(data.data.totalPrice);
               var status = '';
               if (data.data.status == '0') {
                   status = '未支付';
               }else if (data.data.status == '1') {
                   status = '已支付';
               }else {
                   status = '已取消';
               }
               $('#status').val(status);
               $('#employName').val(data.data.employee.employName);
           }
       })
   }
});